import request from '@/utils/request'

// 分类相关 ---------------------------------------------------------------------
// 获取文章分类
export const artGetChannelsService = () => request.get('/my/cate/list')

// 添加文章分类
export const artAddChannelService = (data) => request.post('/my/cate/add', data)

// 编辑文章分类
export const artEditChannelService = (data) => request.put('/my/cate/info', data)

// 删除文章分类
export const artDelChannelService = (id) => request.delete('/my/cate/del', {
  params: { id }
})
// 分类相关 -----------------------------------------------------------------



// 文章相关 -----------------------------------------------------------------------
// 获取文章列表
export const artGetListService = (params) => request.get('/my/article/list', {
  params
})

// 添加文章
// dato 是一个 fromData 格式的对象
export const artPublishArticleService = (data) => request.post('/my/article/add', data)

// 获取文章详情
export const artGetArtDetailService = id => request.get('/my/article/info', {
  params: { id }
})

// 编辑文章
export const artEditArtService = data => request.put('/my/article/info', data)

// 删除文章
export const artDelArtService = (id) => request.delete('my/article/info', { params: { id } })